#!/bin/sh
fm_ids=$1
scanfile_prefix="/home/scanfiles"
exp_data_dir="/home/export/data"

if [ ! -d ${exp_data_dir} ]; then
  mkdir -p "${exp_data_dir}"
fi 
 
cd ${exp_data_dir}
if [ ! -z "${fm_ids}" ]; then
  scan_files=""
  fm_ids_array=$(echo "${fm_ids}" | sed 's/,/ /g')
  for i in ${fm_ids_array}; do
    scan_files="${scan_files}${scanfile_prefix}/$i "
  done
  echo "${scan_files}"
  zip -r export.zip ./*.db ${scan_files}
else
  exit -1
fi


